package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.CrmCpxxMapper;
import com.ruoyi.quartz.domain.CrmCpxx;
import com.ruoyi.quartz.service.ICrmCpxxService;

/**
 * 产品信息Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-14
 */
@Service
public class CrmCpxxServiceImpl implements ICrmCpxxService 
{
    @Autowired
    private CrmCpxxMapper crmCpxxMapper;

    /**
     * 查询产品信息
     * 
     * @param cpid 产品信息主键
     * @return 产品信息
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public CrmCpxx selectCrmCpxxByCpid(Long cpid)
    {
        return crmCpxxMapper.selectCrmCpxxByCpid(cpid);
    }

    /**
     * 查询产品信息列表
     * 
     * @param crmCpxx 产品信息
     * @return 产品信息
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<CrmCpxx> selectCrmCpxxList(CrmCpxx crmCpxx)
    {
        return crmCpxxMapper.selectCrmCpxxList(crmCpxx);
    }

    /**
     * 新增产品信息
     * 
     * @param crmCpxx 产品信息
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertCrmCpxx(CrmCpxx crmCpxx)
    {
        return crmCpxxMapper.insertCrmCpxx(crmCpxx);
    }

    /**
     * 修改产品信息
     * 
     * @param crmCpxx 产品信息
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateCrmCpxx(CrmCpxx crmCpxx)
    {
        return crmCpxxMapper.updateCrmCpxx(crmCpxx);
    }

    /**
     * 批量删除产品信息
     * 
     * @param cpids 需要删除的产品信息主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmCpxxByCpids(Long[] cpids)
    {
        return crmCpxxMapper.deleteCrmCpxxByCpids(cpids);
    }

    /**
     * 删除产品信息信息
     * 
     * @param cpid 产品信息主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmCpxxByCpid(Long cpid)
    {
        return crmCpxxMapper.deleteCrmCpxxByCpid(cpid);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearCpxx() {
        return crmCpxxMapper.clearCpxx();
    }
}
